package reflective;

public class ReflectiveTest5 {
    public static void main(String[] args) throws ClassNotFoundException {

        // 获取Class方式

        //	类名.class
        System.out.println(ReflectiveTest5.class);

        //	对象名.getClass()
        ReflectiveTest5 reflectiveTest5 = new ReflectiveTest5();
        System.out.println(reflectiveTest5.getClass());

        //	Class.forName(全类名)
        Class aClass = Class.forName("reflective.ReflectiveTest5");
        System.out.println(aClass);

        //	类加载方法loadClass
        ClassLoader classLoader = aClass.getClassLoader();
        System.out.println(classLoader.loadClass("reflective.ReflectiveTest5"));
    }
}
